Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Preparing the Sample Description

Next, a sample description is prepared. This is identical to the sample description that would be prepared if the effect was added to a QuickTime movie. The code in Listing 8 creates a sample description.

Listing 8 Preparing a Sample Description

ImageDescriptionHandle QTEffects_MakeSampleDescription
    (OSType theEffectType, short theWidth, short theHeight)

{
    ImageDescriptionHandle mySampleDesc = nil;
    OSErr myErr = noErr;

    // create a new sample description
    myErr = MakeImageDescriptionForEffect(theEffectType, &mySampleDesc);
    if (myErr != noErr)
        return(nil);

    // fill in the fields of the sample description
    (**mySampleDesc).width = theWidth;
    (**mySampleDesc).height = theHeight;

    return(mySampleDesc);
}

To use this code snippet to create a a sample description for an SMPT wipe effect, for example, you would set theEffectType to 'smpt' .


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |